//
//  InitHelper.m
//  TTFriend
//
//  Created by Gary on 2019/5/6.
//  Copyright © 2019 李正兵. All rights reserved.
//

#import "InitHelper.h"
#import "TTSCollectionConfig.h"

@implementation InitHelper

+(instancetype)sharedInitHelper {
    static InitHelper* helper = nil;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        if (!helper) {
            helper = [[self alloc] init];
        }
    });
    return helper;
}

- (void)initApp {
    
    //初始化urlhelper的映射关系
    [self initCollectionViewUrlHelper];
    
}

- (void)initCollectionViewUrlHelper {
    
    NSDictionary *defaultMappingInfo = @{
                                         @(0) : @{
                                                 kTTSCollectionDataSourceClassKey : @"TSCollectionViewDataSource"
                                                 },
                                         
                                         @(ListTypeHome) : @{
                                                 kTTSCollectionUrlKey : @"",
                                                 kTTSCollectionDataManagerClassKey: @"HomeProductASDataManager",
                                                 kTTSCollectionDataSourceClassKey : @"HomeCollectionViewDataSource"
                                                 },
                                         
                                         
                                         };
    [[TTSCollectionConfig sharedInstance] mapWithMappingInfo:defaultMappingInfo];
    
}

@end
